#include "mywidget.h"
#include "ui_mywidget.h"

#include "myplayer/SrVideoWidget.h"

MyWidget::MyWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MyWidget)
{
    ui->setupUi(this);
}

MyWidget::~MyWidget()
{
    delete ui;
}

void MyWidget::on_openBtn1_clicked()
{
     SrVideoWidget *m_vo = new SrVideoWidget(this);
     QVBoxLayout *vBox = new QVBoxLayout();
     vBox->setMargin(0);
     vBox->addWidget(m_vo);
     vBox->layout()->setContentsMargins(0, 0, 0, 0);
     vBox->layout()->setSpacing(0);
     ui->flashcontent1->setLayout(vBox);
     m_vo->show();
     //widget->show();
     dt1.Open("e:\\test.mp4", m_vo);
     dt1.Start();
    //widget->set
}

void MyWidget::on_closeBtn1_clicked()
{
    dt1.Close();
}

void MyWidget::on_openBtn2_clicked()
{
    SrVideoWidget *m_vo = new SrVideoWidget(this);
    QVBoxLayout *vBox = new QVBoxLayout();
    vBox->setMargin(0);
    vBox->addWidget(m_vo);
    vBox->layout()->setContentsMargins(0, 0, 0, 0);
    vBox->layout()->setSpacing(0);
    //vBox->set
    ui->flashcontent2->setLayout(vBox);
    m_vo->show();
    //widget->show();
    dt2.Open("e:\\test.mp4", m_vo);
    dt2.Start();
}

void MyWidget::on_closeBtn2_clicked()
{
    dt2.Close();
}


void MyWidget::on_openBtn3_clicked()
{

}

void MyWidget::on_openBtn4_clicked()
{

}


void MyWidget::on_closeBtn3_clicked()
{

}

void MyWidget::on_closeBtn4_clicked()
{

}
